home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / cm100exe.zip / CM100EXE.EXE / SAMPLES / IF / MAKEFILE < prev    next >
Text File  |  1991-11-16  |  3KB  |  108 lines

  1. /*****************************************************************************
  2. *                              MAKEFILE
  3. *
  4. *  PURPOSE: Build the following modules:
  5. *
  6. *           "hello.obj"
  7. *           "world.obj"
  8. *           "message.lib"
  9. *           "greeting.obj"
  10. *           "greeting.exe"
  11. *
  12. *  NOTE: Since CMAKE automatically determines the dependencies for CL, LIB,
  13. *        and LINK, you would not ordinarily use an if statement to
  14. *        explicitly specify dependencies for these commands.  if statements
  15. *        have been used in this make file for demonstration purposes, only.
  16. *
  17. *        None of the comments in this make file are required.  They have
  18. *        been provided to help you understand how CMAKE handles each
  19. *        command.
  20. *
  21. *****************************************************************************/
  22.  
  23. /*****************************************************************************
  24. *                              HELLO.OBJ
  25. *
  26. *  The following CL and LIB commands will be executed only when one of the
  27. *  following conditions is true:
  28. *
  29. *  1. "hello.obj" does not exist.
  30. *  2. "message.lib" does not exist.
  31. *  3. "hello.c" is newer than "hello.obj".
  32. *  5. "hello.c" is newer than "message.lib".
  33. *  4. "hello.h" is newer than "hello.obj".
  34. *  6. "hello.h" is newer than "message.lib".
  35. *
  36. *****************************************************************************/
  37.  
  38. if ( hello.obj
  39.      message.lib < hello.c
  40.                    hello.h )
  41.  
  42.    {
  43.    cl /c /W4 hello.c
  44.  
  45.    lib message.lib -+hello.obj;
  46.    }
  47.  
  48. /*****************************************************************************
  49. *                               WORLD.OBJ
  50. *
  51. *  The following CL and LIB commands will be executed only when one of the
  52. *  following conditions is true:
  53. *
  54. *  1. "world.obj" does not exist.
  55. *  2. "message.lib" does not exist.
  56. *  3. "world.c" is newer than "world.obj".
  57. *  5. "world.c" is newer than "message.lib".
  58. *  4. "world.h" is newer than "world.obj".
  59. *  6. "world.h" is newer than "message.lib".
  60. *
  61. *****************************************************************************/
  62.  
  63. if ( world.obj message.lib < world.c world.h )
  64.  
  65.    {
  66.    cl /c /W4 world.c
  67.  
  68.    lib message.lib -+world.obj;
  69.    }
  70.  
  71. /*****************************************************************************
  72. *                           GREETING.OBJ
  73. *
  74. *  The following CL command will be executed only when one of the
  75. *  following conditions is true:
  76. *
  77. *  1. "greeting.obj" does not exist.
  78. *  2. "greeting.c" is newer than "greeting.obj".
  79. *  3. "hello.h" is newer than "greeting.obj".
  80. *  4. "world.h" is newer than "greeting.obj".
  81. *  5. "greeting.h" is newer than "greeting.obj".
  82. *
  83. *****************************************************************************/
  84.  
  85. if (   greeting.obj
  86.      < greeting.c
  87.        hello.h
  88.        world.h
  89.        greeting.h )
  90.  
  91.    cl /c /W4 greeting.c
  92.  
  93. /*****************************************************************************
  94. *                           GREETING.EXE
  95. *
  96. *  The following LINK command will be executed only when one of the
  97. *  following conditions is true:
  98. *
  99. *  1. "greeting.exe" does not exist.
  100. *  2. "greeting.obj" is newer than "greeting.exe".
  101. *  3. "message.lib" is newer than "greeting.exe".
  102. *
  103. *****************************************************************************/
  104.  
  105. if ( greeting.exe < greeting.obj message.lib )
  106.  
  107.    link @greeting.lnk
  108.